package com.echo.register.mapper;

import com.echo.register.domain.VoteDetailInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @program: com.echo.voter
 * @description: 自定义detailmapper
 * @author: Xiaoti
 * @create: 2018-11-01 13:20
 **/
@Mapper
public interface DetailInfoMapper {

    @Select("select * from vote_detail_info")
    List<VoteDetailInfo> getDetailList();

    @Insert("INSERT INTO vote_detail_info(detail_id, um_id, cadidate_id, created_time)VALUES (#{detailId}, #{umId}, #{cadidateId}, #{createdTime});")
    void insertDetailInfo(VoteDetailInfo detailInfo);

    @Select("select * from vote_detail_info where um_id = #{umId} and cadidate_id = #{cadidateId} and created_time like #{createdTime}")
    VoteDetailInfo getDetailInfoByUmIdCadidateIdDate(@Param("cadidateId")String cadidateId, @Param("umId") String umId, @Param("createdTime")String createdTime);
}
